import { FC } from "react";
interface FromCollectProps {}
const FromCollect: FC<FromCollectProps> = () => {
  return (
    <>
      <form
        onSubmit={(e) => {
          console.log("default submit", e);
          const formdata = new FormData(
            document.getElementById("formId") as HTMLFormElement
          );
          formdata.forEach((value, key) => {
            console.log(key, value);
          });
          e.preventDefault();
          console.log(formdata.get("file") instanceof Blob);
        }}
        method="post"
        id="formId"
      >
        <input type="file" name="file" />
        <input type="text" name="text" />
        <input type="text" />
        <button
        //   onClick={(form) => {
        //     console.log(
        //       new FormData(document.getElementById("formId") as HTMLFormElement)
        //     );
        // console.log(form);
        //   }}
        >
          button submit
        </button>
        <input type="submit" value="submit" />
      </form>
    </>
  );
};
export default FromCollect;
